<template>
    <a-form :name="'ASD'">
        <FormItem :value="Value" itemKey="TextObject.A.B.C" :FormOption="FormOption" :CopmOption="CopmOption" />
    </a-form>

    <a-button
        @click="
            FormOption.required = !FormOption.required;
            CopmOption.disabled = !CopmOption.disabled;
        "
        >state</a-button
    >
    <a-button @click="Value.state = !Value.state">Enable</a-button>
    <pre>{{ JSON.stringify(Value, null, "  ") }}</pre>
    <pre>{{ JSON.stringify(FormOption, null, "  ") }}</pre>
    <pre>{{ JSON.stringify(CopmOption, null, "  ") }}</pre>
</template>
<script setup>
import FormItem from "./FormItem.vue";
import { ref } from "vue";

var FormOption = ref({
    name: "TextObject.A.B.C",
    hasFeedback: true,
    label: "测试数字",
    required: true,
    help: null,
    labelCol: { span: 3, offset: 0 },
    extra: "ABCSD",
    rules: ["idCard"],
    // rules: async function (val, key, label) {
    //     return new Promise((resolve, reject) => {
    //         setTimeout(() => {
    //             resolve(label + key);
    //         }, 1000);
    //     });
    // },
});
// 15607145693
var CopmOption = ref({
    disabled: true,
});

var Value = ref({
    state: true,
    name: null,
    TextObject: {
        A: {
            B: {
                C: 1,
            },
        },
    },
});
</script>
<style lang="less" scoped></style>
